﻿namespace FactoryPattern
{
    public class SimplePizzaFactory : PizzaFactory
    {
        public override Pizza CreatePizza(string type)
        {
            Pizza pizza = null;

            switch (type.ToLower())
            {
                case "cheese":
                    pizza = new CheesePizza();
                    break;
                case "pepperoni":
                    pizza = new PepperoniPizza();
                    break;
                default:
                    throw new ArgumentException("Invalid pizza type");
            }

            return pizza;
        }
    }
}
